<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>Document</title>
<link rel="stylesheet" href="../assets/agile/css/ratchet/css/ratchet.min.css">
<link rel="stylesheet" href="../assets/agile/css/flat/flat.component.css">
<link rel="stylesheet" href="../assets/agile/css/flat/iconline.css">
<link rel="stylesheet" href="../assets/app/css/app.css" />
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/local.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<style>li b span {
  padding-top: 10px;
}
li b span {
  width:25%;
  text-align:center;
  float: left;
}</style>
</head>
<body>
<!--通用顶部-->
<div id="ios-top-box">
    <div id="header" class="bar bar-nav">
    <div class="titlebar">
    <a href="javascript:appClose('utbuydetail',api);"><i class="iconfont iconline-arrow-left"></i></a>
    <h1 class="title">参团详情</h1>
    </div>
    </div>
</div>
<!--通用顶部结束-->
<section>
<div class="scroller">
	<ul class="listitem count_goods">
	        <li style="border-bottom:1px solid #ccc;">
	        <a href="javascript:;" class="goodstitle" style="display:inline-block;float:left;width:74px;height:74px;"><img data-original="" style="width:74px;height:74px;" class="img lazy"/></a>
	        <div class="text">
	                <p style="padding-left:10px;"><a href="javascript:;" class="goodstitle">加载中...</a></p>
					<p>&nbsp;&nbsp;价值：<em class="gray6 money" style="font-style: normal;">加载中...</em></p>
					<p>&nbsp;&nbsp;团名：<em class="blue q_group_name" style="font-style: normal;">加载中...</em></p>
					<div class="lottery" style="display:none;">
					<p>&nbsp;&nbsp;获得者：<em class="blue" style="font-style: normal;">加载中...</em></p>
					<p>&nbsp;&nbsp;揭晓时间：<em class="gray6" style="font-style: normal;">加载中...</em></p>
					</div>
				</div>
	        </li>
	</ul>
    <ul class="op">
       <li style="padding:8px;">
       	<span>本团商品您总共拥有<em class="orange" style="font-style: normal;">加载中... </em>个云购码</span>
       	<p class="gray9"><font class="time"></font>&nbsp;&nbsp;<span class="gonumber">加载中...人次</span></p>
       </li>
	    <li><b class="goucode">加载中...</b></li>
    </ul>
</div>
<input type="hidden" value="0" name="goods_id"/>
<input type="hidden" value="" name="lottery"/>
</section>
</body>
<script type="text/javascript">
apiready = function(){
	
	$('.goodstitle').click(function(){
		var team_goods_id = $('input[name=goods_id]').val();
		if(team_goods_id == 0){
			api.alert({msg:'参数错误'});
			return;
		}
		localData.set('team_goods_id',team_goods_id);
		if($('input[name=lottery]').val() == 'no'){
			api.openWin({name:'team_item',url:'./team_item.html',reload:true});
		}else if($('input[name=lottery]').val() == 'yes'){
			api.openWin({name:'js_result',url:'./js_result.html',reload:true});
		}
		//获取 api.pageParam['team_goods_id']
	});
	
	if(getUserinfo()){
		lyzimg();
		var team_order_id = localData.get('team_order_id');
		if(!team_order_id){
			api.alert({msg:'参数错误'});
			return;
		}
		var userinfo = getUserinfo();
		GetJPData(config.url+'/app.php?act=teambuy&uid='+userinfo.uid,{team_order_id:team_order_id},function(data){
			if(data['status'] == 1){
				if(data['lottery'] == 'yes'){
					$('.lottery .blue').text(data['shopinfo']['username']);
					$('.lottery .gray6').text(data['shopinfo']['q_end_time']);
					$('.lottery').show();
					$('input[name=lottery]').val('yes');
				}else{
					$('input[name=lottery]').val('no');
				}
				$('input[name=goods_id]').val(data['shopinfo']['id']);
				$('li .img').attr('data-original',config.upload_url+'/'+data['shopinfo']['thumb']);
				$('p a.goodstitle').html(data['shopinfo']['title']);
				$('p em.money').text(data['shopinfo']['money']);
				$('p em.q_group_name').text(data['shopinfo']['q_group_name']);
				$('.op em.orange').text(data['data']['gonumber']);
				$('.op font.time').text(data['data']['time']);
				$('.op span.gonumber').text(data['data']['gonumber']+'人次');
				$('.op b.goucode').html(data['data']['goucode']);
				lyzimg();
			}else{
				api.alert({msg:data['msg']},function(index,err){
					localData.remove('team_order_id');
					appClose('utbuydetail',api);
				});
			}
		});
	}else{
		$.PageDialog.fail('请登录用户');
	}
};
</script>
</html>